<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>Home</title>
        
        
        <script type="text/javascript" src="Scripts/jquery-1.9.0.js"></script>        
        <link rel="stylesheet" type="text/css" href="Style/siteStyle.css"/>
        <link rel="stylesheet" type="text/css" href="Style/pluginStyle.css"/>
         
        <?php include './config.php'; ?>
        <?php include './db/configurazioni.php'; ?>
        <?php 
        $result= "";
        if(isset($_REQUEST['Login']))
        {
        	$conf = new configurazioni();        	
        	                 
            $username = $_POST["username"];
            $psw = $_POST["psw"];                
        	$result = $conf->CheckUser($username, $psw);
        	if($result)
        	{
        		session_start();
        		$_SESSION['login']="auth"; 
        		header("location: index.php");
        	}		  		        	  	
        }
        ?>
    </head>
    <body>
        <div class="container">      
            <?php echo $result?>
            <!-- header -->
            <div class="header">
			    <div class="logo">
			        <a href="../../<?php echo $rootPath ?>/index.php" style="text-decoration: none;"> 
			            <img style="border:none" src="../../<?php echo $rootPath ?>/Style/Images/logoPC.jpg"/>                
			        </a>
			    </div>
			    <div class="titolo">
			        <h1>
			            Sito Amministrazione Protezione Civile
			        </h1>                
			    </div>
			    <div style="clear: both"></div>   
			</div>
        
            <div>
            <form method="post">
                <!-- contenuto -->
                <div class="mainContent">
                    <h1>Sito di amministrazione protezione civile</h1>
                    <label>Utente: </label>                    
                    <input type="text" name="username">
                    <label>Password: </label>
                    <input type="text" name="psw">
                    <button type="submit" name="Login" value="Login">OK</button>
                </div>
            </form>     			    
                    
                
                <div style="clear:both"></div>
                
                
            </div>
        </div>
        
    </body>
</html>
